<?php

 /**
  * @package JooS
  * @subpackage PHPackager
  */

  class JooS_PHPackager_Archive extends ZipArchive {
    /**
     * @var JooS_PHPackager_File_Adapter
     */
    private $_adapter = null;

    public function  __construct(JooS_PHPackager_File_Adapter $adapter) {
      $this->_adapter = $adapter;
    }

    /**
     * @return JooS_PHPackager_File_Adapter
     */
    public function getAdapter() {
      return $this->_adapter;
    }
/**
    public function open($flags = null) {
      $name = $this->getAdapter()->get_name();
      return parent::open($name, $flags);
    }
 */

    public function create() {
      $name = $this->getAdapter()->get_name();
      return $this->open($name, self::CREATE);
    }
  }
